<template>
  <a-drawer
    :width="drawerWidth"
    @close="handleCancel"
    :visible="visible"
    :confirmLoading="confirmLoading"
  >
    <template  slot="title">
      <div style="width: 100%;">
        <span>{{ title }}</span>
        <span style="display:inline-block;width:calc(100% - 51px);padding-right:10px;text-align: right">
          <a-button @click="toggleScreen" icon="appstore" style="height:20px;width:20px;border:0px"></a-button>
        </span>
      </div>
    </template>
    <div :style="{width: '100%',padding: '10px 16px',background: '#fff',}">

      <a-spin :spinning="confirmLoading">
        <a-form :form="form">

          <a-form-item
            :labelCol="labelCol"
            :wrapperCol="wrapperCol"
            label="机构">
            <ak-tree-select :url="sysDepartUrl.tree" v-decorator="['tenantId', {rules:getValidatorRolesRequired()}]"></ak-tree-select>
          </a-form-item>
          <a-form-item
            :labelCol="labelCol"
            :wrapperCol="wrapperCol"
            label="名称">
            <a-input autocomplete="off" placeholder="请输入名称" v-decorator="['name', {rules:getValidatorRolesRequired(200)}]"/>
          </a-form-item>


          <a-form-item
            :labelCol="labelCol"
            :wrapperCol="wrapperCol"
            label="描述"
            hasFeedback >
            <a-textarea placeholder="请输入描述" v-decorator="['describeInfo', {rules:[{ max: 200, message: '长度在 200 个字符', trigger: 'blur'}]}]" />
          </a-form-item>

          <a-form-item
            :labelCol="labelCol"
            :wrapperCol="wrapperCol"
            label="流程文件"
            hasFeedback >
            <ak-upload v-decorator="['processBpmn']" :file-length="1" type="temFile" />
          </a-form-item>
          <a-form-item
            :labelCol="labelCol"
            :wrapperCol="wrapperCol"
            label="流程图片"
            hasFeedback >
            <ak-upload v-decorator="['processImg']" :file-length="1" type="temFile" />
          </a-form-item>
        </a-form>
      </a-spin>
      <div class="drawer-bootom-button" v-show="!disableSubmit">
        <a-popconfirm title="确定放弃编辑？" @confirm="handleCancel" okText="确定" cancelText="取消">
          <a-button style="margin-right: .8rem">取消</a-button>
        </a-popconfirm>
        <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">提交</a-button>
      </div>
    </div>
  </a-drawer>
</template>

<script>
  import AkfhModelDrawMixin from '../../../mixin/AkfhModelDrawMixin'
  import {activitModelUrl, sysDepartUrl} from '../../../api/url'
  import AkUpload from '../../../components/akfh/AkUpload'
  import AkTreeSelect from '../../../components/akfh/AkTreeSelect'

  export default {
    name: "ModelModal",
    components: { AkTreeSelect, AkUpload },
    mixins:[AkfhModelDrawMixin],
    data () {
      return {
        url: activitModelUrl,
        sysDepartUrl:sysDepartUrl
      }
    },
    created () {
    },
    methods: {



    }
  }
</script>

<style scoped>

</style>